var t = getApp();

Page({
    data: {
        list: [],
        page: 1,
        last_page: 1,
        httpUrl: "",
        amount: ""
    },
    onLoad: function(t) {
        "lawyer" == t.order_type ? this.setData({
            httpUrl: "plugin.lawyer-platform.frontend.controllers.dividend.getLawyer"
        }) : this.setData({
            httpUrl: "plugin.lawyer-platform.frontend.controllers.dividend.getLawyerFirm"
        }), this.getData();
    },
    getData: function() {
        var a = this;
        t._postNetWork({
            url: t.getNetAddresss(this.data.httpUrl),
            success: function(e) {
                1 == e.data.result ? a.setData({
                    list: e.data.data.list.data,
                    amount: e.data.data.amount_total,
                    last_page: e.data.data.list.last_page
                }) : t.tips(e.data.msg);
            }
        });
    },
    getMoreData: function() {
        var a = this, e = this.data.page + 1;
        t._postNetWork({
            url: t.getNetAddresss(this.data.httpUrl),
            data: {
                page: e
            },
            success: function(s) {
                if (1 == s.data.result) {
                    var r = a.data.list.concat(s.data.data.list.data);
                    a.setData({
                        page: e,
                        list: r,
                        last_page: s.data.data.list.last_page
                    });
                } else t.tips(s.data.msg);
            }
        });
    },
    onReachBottom: function() {
        if (this.data.page >= this.data.last_page) return !1;
        this.getMoreData();
    },
    onShareAppMessage: function() {}
});